﻿<Window x:Class="WpfHighContrast.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
  <Window.Resources>
    <Style TargetType="{x:Type Button}">
      <Setter Property="SnapsToDevicePixels" Value="true"/>
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="MinHeight" Value="23"/>
      <Setter Property="MinWidth" Value="75"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Border 
          x:Name="Border"  
          CornerRadius="2" 
          BorderThickness="1"
          Background="#C0C0C0"
          BorderBrush="#404040">
              <ContentPresenter 
            Margin="2"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            RecognizesAccessKey="True"/>
            </Border>
            <ControlTemplate.Triggers>
              <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter TargetName="Border" Property="BorderBrush" Value="#202020" />
              </Trigger>
              <Trigger Property="IsDefaulted" Value="true">
                <Setter TargetName="Border" Property="BorderBrush" Value="#202020" />
              </Trigger>
              <Trigger Property="IsMouseOver" Value="true">
                <Setter TargetName="Border" Property="Background" Value="#808080" />
              </Trigger>
              <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="Border" Property="Background" Value="#E0E0E0" />
                <Setter TargetName="Border" Property="BorderBrush" Value="#606060" />
              </Trigger>
              <Trigger Property="IsEnabled" Value="false">
                <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                <Setter Property="Foreground" Value="#888888"/>
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </Window.Resources>
    <Grid>
    <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="41,40,0,0" Name="button1" VerticalAlignment="Top" Width="75" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="166,44,0,0" Name="textBlock1" Text="TextBlock" VerticalAlignment="Top" />
    <RadioButton Content="RadioButton" Height="16" HorizontalAlignment="Left" Margin="56,96,0,0" Name="radioButton1" VerticalAlignment="Top" />
    <TextBox Height="23" HorizontalAlignment="Left" Margin="182,89,0,0" Name="textBox1" Text="OKTextBox" VerticalAlignment="Top" Width="120" />
  </Grid>
</Window>
